home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 1 (Walnut Creek)
/
Aminet - June 1993 [Walnut Creek].iso
/
aminet
/
biz
/
demo
/
origins.lzh
/
ARexx
/
EditGen.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1992-12-23
|
3KB
|
91 lines
/********************************************/
/* Edit a SOURCE or NOTE file from Origins */
/********************************************/
/* This script will attempt to load the SOURCE or NOTE file requested by
Origins into the editor of your choice. The function may be blocking or
non-blocking by your choice. As written, and with the specified editor,
the function is non-blocking.
When Origins calls this script, it does so in a blocking manner; the
program won't continue until the script returns. If you wish this
behaviour, make the script block until you are done with the file.
Otherwise, make the script return immediately.
If your editor doesn't do a ScreenToFront() when called, you'll have to
switch to the editor's screen to see it.
SPECIAL NOTE: If Origins is started from Workbench, and the edit SOURCE
and NOTE file functions appear not to do anything, the problem may be
that Origins can't find RX and this script can't find your editor.
If this seems to be the case, the easiest thing to do about it is to move
RX to C: so that Origins can find it. If there is still a problem and
the editor used in this script is not in C:, you can either move it to C:
or specify an absolute path, i.e. instead of
Editor = 'UEX ' try Editor = 'SYS:Tools/UEX '
This should clear up any problems with these functions not working
properly when Origins is started from Workbench.
*/
/* Enable error handling routines */
Signal On Error
Signal On Syntax
Signal On Halt
Signal On IOErr
/* Change this string to the name of your editor */
/* Make sure to include the space after the name */
Editor = 'UEX '
/* Change this string to the name of your editor's ARexx port */
/* Always remember that port names are case-sensitive */
MyPort = 'URexx'
/* Change this string to the name of your editor's ARexx load */
/* command. Make sure to include the space after the name. */
Command = 'loadfile '
/* Get the name of the file to edit into this variable */
parse arg Filename
/* If the editor isn't up, start it */
If (~Show('P',MyPort)) then do
address command 'run 'Editor Filename
Exit
End
/* Else, set up the address */
address value MyPort
/* and tell the editor to load this file */
Command Filename
Exit
/**********************************************************************/
/* Error Handling */
/**********************************************************************/
Error:
Parse Source Type Num MacroName Script Prog Port
say 'ERROR: Macro "'MacroName'", Error: #'RC' ("'ErrorText(RC)'") on line 'SIGL' **'
exit
Syntax:
Parse Source Type Num MacroName Script Prog Port
say 'SYNTAX: Macro "'MacroName'", Error: #'RC' ("'ErrorText(RC)'") on line 'SIGL' **'
exit
Halt:
Parse Source Type Num MacroName Script Prog Port
say 'HALT: Macro "'MacroName'", Error: #'RC' on line 'SIGL' **'
exit
IOErr:
Parse Source Type Num MacroName Script Prog Port
say 'IOERR: Macro "'MacroName'", Error: #'RC' on line 'SIGL' **'
exit